//appending $new in our array array_unshift($arr, $new); //now make it unique. $final = array_unique($arr);